<?php
// Import des classes, initialisation session etc ...
require_once 'includes/haut.php';
if(isset($_SESSION["client"])){
	header("Location:index.php");
	exit();
}
require_once 'modules/membre.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>
			Inscription
		</title>
		<?php include('includes/headLinks.php');?>
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/i18n/jquery-ui-i18n.min.js"></script>
		<script type="text/javascript" src="js/dateNaissance.js"></script>
		<script type="text/javascript" src="js/formulaire.js"></script>
	</head>
	<body>

		<div id="entete">
			<?php include('includes/entete.php'); ?>
		</div>
	
		<div id="navigation">
			<?php include('includes/navigation.php'); ?>
		</div>

		<div id="principal">
			
		<form action="formulaire.php" method="post" id="form">
			<h2>Cr&eacute;ez votre compte client !</h2>
			<div class="error">
			<?php 
				if(isset($utilisateur)){
					if ($erreurs != "") {
						$err1 = '<div class="ui-state-error ui-corner-all">';
						$err2 = '</div>';
						echo $err1.$erreurs.$err2;
					}
				}else 
					$utilisateur = new utilisateur();	
			?>
			</div>
			<table>			
		       	<tr>
		       		<td><label for="nom">Nom : </label></td>
	 				<td><input type="text" name="nom" id="nom" maxlength="30" value="<?php echo $utilisateur->getNom() ;?>"/></td>  
	 				<td><img class="pastillePseudo" src="images/icones/error.png" alt="nom_error" title="Pseudo indisponible" />
	      				<img class="pastillePseudo" src="images/icones/ok.png" alt="nom_ok" title="Pseudo disponible" />
	      				<span class="error"></span>
	      			</td>
		 		</tr>
		 		<tr>
	    	  		<td><label for="prenom">Pr&eacute;nom : </label></td>
	      			<td><input type="text" name="prenom" id="prenom" maxlength="30" value="<?php echo $utilisateur->getPrenom() ;?>"/></td>
	      			<td><img class="pastillePseudo" src="images/icones/error.png" alt="prenom_error" title="Pseudo indisponible" />
	      				<img class="pastillePseudo" src="images/icones/ok.png" alt="prenom_ok" title="Pseudo disponible" />
	      				<span class="error"></span>
	      			</td>
	      		</tr>
	      		<tr>
		      		<td><label for="email">E-mail : </label></td>
	      			<td><input type="email" name="email" id="email" maxlength="50" value="<?php echo $utilisateur->getEmail() ;?>"/></td>
	      			<td><img class="pastillePseudo" src="images/icones/error.png" alt="email_error" title="Pseudo indisponible" />
	      				<img class="pastillePseudo" src="images/icones/ok.png" alt="email_ok" title="Pseudo disponible" />
	      				<span class="error"></span>
	      			</td>
	      		</tr>
	      		<tr>
		      		<td><label for="dateNaissance">Date de naissance :</label></td>
					<td><input type="text" name="dateNaissance" id="dateNaissance"
							maxlength="10" value="<?php echo $utilisateur->getDateNaissance() ;?>" />
					</td>
	      		</tr>
	      		<tr>
		      		<td>Sexe :</td>
	      			<td>
		      			<input type="radio" name="sexe" value="f" id="femme" <?php if($utilisateur->getSexe()!="h" ) echo 'checked="checked"';?> />
	      				<label for="femme">Femme</label>
	      				<input type="radio" name="sexe" value="h" id="homme" <?php if($utilisateur->getSexe()=="h") echo 'checked="checked"';?>/>
	      				<label for="homme">Homme</label>
	      			</td>
	      		</tr>
				<tr>
		      		<td><label for="nomUsager">Nom d'usager : </label></td>
	      			<td><input type="text" name="nomUsager" id="nomUsager" maxlength="30" value="<?php echo $utilisateur->getNomUsager() ;?>" /></td>
	      			<td><img class="pastillePseudo" src="images/icones/error.png" alt="pseudo_indisponible" title="Pseudo indisponible" />
	      				<img class="pastillePseudo" src="images/icones/ok.png" alt="pseudo_disponible" title="Pseudo disponible" />
	      				<span class="error"></span>
	      			</td>
	      		</tr>
	      		<tr>
		      		<td><label for="mdp">Mot de passe : </label></td>
	      			<td><input type="password" name="mdp" id="mdp" maxlength="30"/></td>
	      			<td><img class="pastillePseudo" src="images/icones/error.png" alt="pass_error" title="Pseudo indisponible" />
	      				<img class="pastillePseudo" src="images/icones/ok.png" alt="pass_ok" title="Pseudo disponible" />
	      				<span class="error"></span>
	      			</td>
	      		</tr>
	      		<tr>
	      			<td><label for="verif_mdp">Verification Mot de passe : </label></td>
	      			<td><input type="password" name="verif_mdp" id="verif_mdp" maxlength="30" /></td>
	      			<td><img class="pastillePseudo" src="images/icones/error.png" alt="pass2_error" title="Pseudo indisponible" />
	      				<img class="pastillePseudo" src="images/icones/ok.png" alt="pass2_ok" title="Pseudo disponible" />
	      				<span class="error"></span>
	      			</td>
	      		</tr>
	    	</table>
	    	<p>
		      	<input type="checkbox" name="licence" id="licence" />
	      		<label for="licence"><em>J'accepte les termes de la licence.</em> </label>
	      		<img class="pastillePseudo" src="images/icones/error.png" alt="licence_error" title="Pseudo indisponible" />
	      				<img class="pastillePseudo" src="images/icones/ok.png" alt="licence_ok" title="Pseudo disponible" />
	      				<span class="error"></span>
	      				<br/><br/>
	    	</p>
      		<p><center>
      			<input type="submit" id ="envoyer" name="envoyer" value="Envoyer"/>
	      		&nbsp;&nbsp;&nbsp;&nbsp;
      			<input type="reset" name="reset" value="R&eacute;initialiser"/>
			</center></p>
			<p>
			<input type="hidden" name="action" value="ajouter"/>
			</p>
		</form>
	
	</div>
	
	<div id="publicite">
		<?php include('includes/publicite.php'); ?>
	</div>

</body>
</html>

